﻿     <link href="@Url.Content("~/Content/jquery-easyui-1.3.3/themes/default/easyui.css")" rel="stylesheet" />
    <link href="@Url.Content("~/Content/jquery-easyui-1.3.3/themes/icon.css")" rel="stylesheet" type="text/css" />
    @*引用easyUI的JS*@
    <script src="@Url.Content("~/Content/jquery-easyui-1.3.3/jquery-1.8.0.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Content/jquery-easyui-1.3.3/jquery.easyui.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Content/jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js")" type="text/javascript"></script>
 <script type="text/javascript">
     $(function () {
         BindTreeGrid();
     });

     function BindTreeGrid() {
         $('#tt').treegrid({
             url: '../Menu/MenuListContent',
             treeField: 'MenuName',
             idField: 'MenuID',
             rownumbers: true,
             animate: true,
             columns: [[

             { title: '菜单权限名称', field: 'MenuName', width: 180 },

             { field: 'MenuParent', title: '上级权限ID', width: 80 },

             { field: 'MenuDescript', title: '备注', width: 80 }

          ]],
             onBeforeExpand: function (row) {
                 //动态设置展开查询的url  
                 var url = "../Menu/MenuListContent?MenuID=" + row.treeid;
                 $("#tt").treegrid("options").url = url;
                 return true;
             },
             onExpand: function (row) {
                 debugger;
             }

         });  

     }
 </script>
<div>  
   <table id="tt"></table>  
</div>